import njust.csc.aecore.utils.CommandUtils
import njust.csc.aecore.utils.PathUtils
import org.junit.jupiter.api.Test

/**
 * @Author ZhouHang
 * @Date 24/6/7 周五
 */
class CommandTest {
    @Test fun `Test Pull Command`() {
        val pullCmd = CommandUtils.pullCmd + listOf(
            "/sdcard/Download/PCAPdroid/1",
            PathUtils.getPCAPDir().toAbsolutePath().toString()
        )
        println("[exe]: ${pullCmd.joinToString(separator = " ")}")
        val processBuilder = ProcessBuilder(pullCmd)
            .redirectErrorStream(true)
            .redirectOutput(ProcessBuilder.Redirect.INHERIT)
        val process = processBuilder.start()
        process.waitFor()
    }
}